package com.medium.house.repository;

import com.medium.house.entity.WechatUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface WechatUserMapper {
    String[] ORDERBY = {"openid", "unionid", "session_key", "mobile", "name", "nickName", "avatarUrl", "gender", "city", "province", "country", "language", "status", "type", "remark", "created_at", "updated_at"};
    String[] ORDER = {"desc", "asc"};

    int deleteByPrimaryKey(Long id);

    int insert(WechatUser record);

    int insertSelective(WechatUser record);

    WechatUser selectByPrimaryKey(Long id);

    WechatUser selectWechatUserByArgs(@Param("param") Map<String, Object> args);

    WechatUser selectWechatUserByOpenid(@Param("openid") String openid);

    int updateByPrimaryKeySelective(WechatUser record);

    int updateByPrimaryKey(WechatUser record);

    List<WechatUser> selectByPage(
            @Param("start") int start,
            @Param("limit") int limit,
            @Param("orderby") String orderby,
            @Param("order") String order,
            @Param("param") Map<String, Object> args);

    List<Long> selectIdsByPage(
            @Param("start") int start,
            @Param("limit") int limit,
            @Param("orderby") String orderby,
            @Param("order") String order,
            @Param("param") Map<String, Object> args);

    long count(@Param("param") Map<String, Object> args);
}